<%@ page language="java" contentType="text/html; charset=UTF-8"
	import="com.stx.bean.*,java.util.*" pageEncoding="UTF-8"%>
	<%@ include file="include.jsp" %>
<%
	
	BlogUser user = (BlogUser) session.getAttribute("USER");
	//获取类型信息
	List list = (List) session.getAttribute("cates");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>博客</title>
<link rel="stylesheet" type="text/css" href="<%=basePath%>/css/top.css" /> 

<style>
body{
background-image:url("<%=basePath%>/images/01.jpg");
width:600px;
height:1000px;
}
</style>
</head>
<body id="background">
<div id="top1">
<div>
  <div id="top">
     <img alt="logo" src="<%=basePath%>/images/logo.gif" class="logo">
  </div>
</div>

	<%
		if (user == null) {
	%>
	<table width="100%">
		<tr>
			<td width="80%">
				<%
					for (int i = 0; i < list.size(); i++) {
							Category cate = (Category) list.get(i);
				%> <a href="<%=basePath%>blogselbycate?cateid=<%=cate.getId()%>"><%=cate.getCateName()%></a>
				<%
					}
				%>
			</td>
			<td width="20%"><a href="<%=basePath%>page/register.jsp">注册</a>
				<a href="<%=basePath%>page/login.jsp">登录</a></td>
		</tr>
	</table>
	<%
		} else {
	%>
	<table width="100%">
		<tr>
			<td>
				<%
					for (int i = 0; i < list.size(); i++) {
							Category cate = (Category) list.get(i);
				%> 
				<a href="<%=basePath%>blogselbycate?cateid=<%=cate.getId()%>"><%=cate.getCateName()%></a>
				<%
					}
				%>
			</td>
		</tr>

		<tr>
			<td width="80%" class="content">
			<a href="<%=basePath%>blogselbyuser">我的全部博文</a>
			<a href="<%=basePath%>cateservlet">新增博文 </a></td>
			<td width="20%"><%=user.getRealname()%>，欢迎您！
			 <a href="<%=basePath%>logout">退出登录</a></td>
		</tr>
		
	</table>
	<%
		}
	%>

</div>
</body>
</html>